
const jwt = require("jsonwebtoken")

const key = "appweb123"

const JWT = {
    generate(value, expires) {
        return jwt.sign(value, key, { expiresIn: expires })
    },
    verify(value) {
        try {
            return jwt.verify(value, key)

        } catch (error) {
            return false
        }
    }
}
module.exports = JWT